﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<script type="text/javascript">
    $(function () {
        initControl();
        getTopContent();
        treeView();
    });
    function initControl() {
        var height = $(window).height() - 178;
        $('#tree_container').css("height", height);
        emptyDataById("#detailContent");
    }
    function getTopContent() {
        emptyDataById("#topContent");
        $.getJSON("/BOM/Product/GetMultiQueryTopJson?seed" + new Date().getTime(), function (data) {
            if (data.length > 0) {
                setDataByJson("#topContent", data[0], "top");
                FSign = data[0].FSign;
                if (data[0].FSign == "H") {
                    $('#topContentNum').text("零件编号");
                    $('#topContentName').text("零件名称");
                    $('#topContentDate').text("回归日期");
                    $('#topContentTime').text("回归时间");
                } else {
                    $('#topContentNum').text("总成系统");
                    $('#topContentName').text("总成名称");
                    $('#topContentDate').text("展开日期");
                    $('#topContentTime').text("展开时间");
                }
            }
        });
    }
    function treeView() {
        var $tree = $("#itemTree").treeview({
            url: "/BOM/Product/GetMultiQueryStructureJson?seed=" + new Date().getTime(),
            param: { id: "0" },
            onnodeclick: function (item) {
                emptyDataById("#detailContent");
                var array = item.text.split('，');
                if (array.length == 6) {
                    $("#WZH").val(array[0]);
                    $("#TH").val(array[1]);
                    $("#MC").val(array[2]);
                    $("#SL").val(array[3]);
                    $("#StartDate").val(array[4]);
                    $("#StopDdate").val(array[5]);
                }
            }
        });
    }
    function btn_calculate() {
        $.detailOpen({
            id: "Detail",
            title: "",
            url: "/BOM/Product/MultiQueryCalculate"
        });
    }
    function resetPage() {
        $.detailClose();
        $("#tree_container").scrollTop(0);
        getTopContent();
        treeView();
    }
</script>
<div id="layout" style="height: 100%; width: 100%;">
    <form id="form1">
        <div style="padding: 12px 0 5px 0; padding-left: 15px; border-bottom: 1px solid #ccc; text-align:right;" class="line-table input-width-185">
            <div class="btn-group">
                <a id="" class="btn btn-primary center-block" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span> 刷新</a>
                <a id="" class="btn btn-primary center-block" onclick="" href="/BOM/Product/MultiQuery"><span class="glyphicon glyphicon-th-list"></span> 明细</a>
                <a id="" class="btn btn-primary center-block disabled" onclick="" href="/BOM/Product/MultiQueryStructure"><span class="glyphicon glyphicon-list-alt"></span> 结构</a>
                <a id="" class="btn btn-primary center-block" onclick="btn_calculate()"><span class="glyphicon glyphicon-edit"></span> 计算</a>
                <a id="" class="btn btn-primary center-block disabled" onclick=""><span class="glyphicon glyphicon-download"></span> 导出</a>
            </div>
        </div>
        <table id="topContent" class="form" style="margin:5px 0 5px 15px;width:1060px">
            <tr>
                <th id="topContentNum" class="formTitle" style="width:60px;">
                    总成系统
                </th>
                <td class="formValue" style="width:220px;">
                    <input id="topTH" name="topTH" type="text" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle" style="width:40px;">
                    类
                </th>
                <td class="formValue" style="width:80px;">
                    <input id="topLEI" name="topLEI" type="text" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle" style="width:40px;">
                    装配
                </th>
                <td class="formValue" style="width:200px;">
                    <input id="" name="" type="text" style="width:60px;" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle" style="width:40px;">
                    版本
                </th>
                <td class="formValue" style="width:60px;">
                    <input id="topBB" name="topBB" type="text" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle" style="width:60px;">
                    更改单号
                </th>
                <td class="formValue" style="width:120px;">
                    <input id="topLXD" name="topLXD" type="text" class="form-control" readonly="readonly" />
                </td>
                <th id="topContentDate" class="formTitle" style="width:60px;">
                    展开日期
                </th>
                <td class="formValue" style="width:80px;">
                    <input id="topFCreateDate" name="topFCreateDate" type="text" class="form-control" readonly="readonly" />
                </td>
            </tr>
            <tr>
                <th id="topContentName" class="formTitle">
                    总成名称
                </th>
                <td class="formValue">
                    <input id="topMC" name="topMC" type="text" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle">
                    特征
                </th>
                <td class="formValue">
                    <input id="topTX" name="topTX" type="text" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle">
                    制造
                </th>
                <td class="formValue">
                    <input id="" name="" type="text" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle">
                    版次
                </th>
                <td class="formValue">
                    <input id="topBC" name="topBC" type="text" class="form-control" readonly="readonly" />
                </td>
                <th class="formTitle">
                    参考图号
                </th>
                <td class="formValue">
                    <input id="topCTH" name="topCTH" type="text" class="form-control" readonly="readonly" />
                </td>
                <th id="topContentTime" class="formTitle">
                    展开时间
                </th>
                <td class="formValue">
                    <input id="topFCreateTime" name="topFCreateTime" type="text" class="form-control" readonly="readonly" />
                </td>
            </tr>
        </table>
    </form>
    <div id="tree_container" style="border:1px solid #ccc;background:#fff;overflow:auto;height:300px;">
        <div id="itemTree"></div>
    </div>
    <table id="detailContent" class="form" style="margin:5px 0 5px 15px;width:880px">
        <tr>
            <th id="" class="formTitle" style="width:60px;">
                位置号
            </th>
            <td class="formValue" style="width:80px;">
                <input id="WZH" name="WZH" type="text" class="form-control" readonly="readonly" />
            </td>
            <th class="formTitle" style="width:60px;">
                零件编号
            </th>
            <td class="formValue" style="width:220px;">
                <input id="TH" name="TH" type="text" class="form-control" readonly="readonly" />
            </td>
            <th class="formTitle" style="width:60px;">
                装配路线
            </th>
            <td class="formValue" style="width:200px;">
                <input id="" name="" type="text" style="width:60px;" class="form-control" readonly="readonly" />
            </td>
            <th id="" class="formTitle" style="width:60px;">
                生效日期
            </th>
            <td class="formValue" style="width:140px;">
                <input id="StartDate" name="FCreateDate" type="text" class="form-control" readonly="readonly" />
            </td>
        </tr>
        <tr>
            <th id="topContentName" class="formTitle">
                数量
            </th>
            <td class="formValue">
                <input id="SL" name="SL" type="text" class="form-control" readonly="readonly" />
            </td>
            <th class="formTitle">
                零件名称
            </th>
            <td class="formValue">
                <input id="MC" name="MC" type="text" class="form-control" readonly="readonly" />
            </td>
            <th class="formTitle">
                制造路线
            </th>
            <td class="formValue">
                <input id="" name="" type="text" class="form-control" readonly="readonly" />
            </td>
            <th id="" class="formTitle">
                失效日期
            </th>
            <td class="formValue">
                <input id="StopDdate" name="FCreateTime" type="text" class="form-control" readonly="readonly" />
            </td>
        </tr>
    </table>
</div>

